import Vue from 'vue'
import App from './App'
import store from './static/js/store/store.js'
import config from './static/js/config.js'
import messages from './locale/index'
import VueI18n from 'vue-i18n'
import VueLazyload from 'vue-lazyload'
const loadimage = require('./static/img/common/lazyimg.png')
const errorimage = require('./static/img/common/lazyimg.png')


let i18nConfig = {
  locale: uni.getLocale(),
  messages
}

Vue.prototype.$config = config;
import * as http from './static/js/request.js';
Vue.prototype.$http  = http;

//权限相关的判断
import {common} from './static/js/mixin/common.js';
Vue.mixin(common);

// 挂载全局方法
import configs from "./common/config.js";
Vue.prototype.configs=configs;
// import lib from "./common/lib.js"
// Vue.prototype.lib=lib

import request from "./common/request.js";
Vue.prototype.$httpas = request;

Vue.prototype.$mbgColor='#ffffff'
Vue.use(VueI18n)
Vue.use(VueLazyload, {
  preLoad: 1.3,
  error: errorimage,
  loading: loadimage,
  attempt: 1
})
const i18n = new VueI18n(i18nConfig)
Vue.config.productionTip = false
App.mpType = 'app'

const app = new Vue({
  i18n,
  ...App,
	store
})
app.$mount()